<?php
//邀请返利页面
include("common.inc.php");
InitGP(array("action")); //初始化变量全局返回
include(INC_PATH."/group.class.php"); //包含团购类
$gp=new GroupClass();
//判断后台是否设置首页显示团购ID
if(GetNum($cfg_index_group)){
	$gid=GetNum($cfg_index_group);
}else {
	//自动显示当天ID团购
	$todaystart=strtotime(date('Y-m-d 0:0:0',time()));
	$todayend=strtotime(date('Y-m-d 0:0:0',time()+3600*24));
	$wheresql="group_begin_time >{$todaystart} and group_begin_time < {$todayend}";
	//$wheresql="TO_DAYS(group_begin_time) = TO_DAYS(NOW())";
	$returnarray = $gp->getdata(1,"",$wheresql);
	
	$gid=$returnarray[0]['gid'];//设置查询到的gid
	unset($returnarray);	//清空数组
	
}
if (empty($gid)) {
	$gid=11;
}

$value=$gp->getone($gid); 	//获取团购信息



include template('referrals');//包含输出指定模板
?>